UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L4t/GhYJJCSz7G7Rb4hK6cKZf+QvYh7h/+4OjoiHzyw=' 
WHERE 
  key_id = 'd14d56457142556c937e52276df1333601dae0b149a9bf537922048357a512b4' 
  AND (
    token = 'L4t/GhYJJCSz7G7Rb4hK6cKZf+QvYh7h/+4OjoiHzyw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026