UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5cOS3Gqx+zv3czpf3e/XJJgeCgLlyUbehuzdwU+o6RE=' 
WHERE 
  key_id = '102f63f5aeb6322280361d118b6287cc36c847f0aff011515cbd1500c0b146fc' 
  AND (
    token = '5cOS3Gqx+zv3czpf3e/XJJgeCgLlyUbehuzdwU+o6RE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017