UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Co7ztvMqQU2ocvTZ6NpFdcazbxqhCkiQecEck6QcfoE=' 
WHERE 
  key_id = 'e6b75e671b061352f9a3209cd249cd6a80d16f0d46b86fd6962ef4afe076ae5a' 
  AND (
    token = 'Co7ztvMqQU2ocvTZ6NpFdcazbxqhCkiQecEck6QcfoE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040