UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DeciNBqcdiGGiQ90L/E6k0V9vnkp0/+nmYQwPRu0qtQ=' 
WHERE 
  key_id = '58011b22f3958c83ab02db41f54c06ac8268d87a7bf2cde36a298f12e9f720ce' 
  AND (
    token = 'DeciNBqcdiGGiQ90L/E6k0V9vnkp0/+nmYQwPRu0qtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022