UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z173aLGirxeC91ElPcFNFq4gslqiwHfL2oK2l6FNT9Y=' 
WHERE 
  key_id = '2ba35491bfb1b4027c6e625f50e85f7b92d981768a8728ad8a46231f16ba3978' 
  AND (
    token = 'Z173aLGirxeC91ElPcFNFq4gslqiwHfL2oK2l6FNT9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030