UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lGEPc9wEg4h7EJ6lvuhYeN/L4naBYhi7U7liqu23jUY=' 
WHERE 
  key_id = 'e03723607bc314194e3673c398af1d918a89bde0a26edb5765911b41ff39f45a' 
  AND (
    token = 'lGEPc9wEg4h7EJ6lvuhYeN/L4naBYhi7U7liqu23jUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032