UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8M4sfQFhSMZZv1OjO24E/2fMwd6Q4UYNmW5V6V0dgKk=' 
WHERE 
  key_id = 'c84d5d04b722e13d70251a4c26c5dca9ae16defbad0fc488d44d696270723a31' 
  AND (
    token = '8M4sfQFhSMZZv1OjO24E/2fMwd6Q4UYNmW5V6V0dgKk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029