UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zFp2/x9lKZK6lzbAnj2KeJq7RredwKVXsf4vcsq9j3M=' 
WHERE 
  key_id = '58b75ad5e041aad33b1d86a8ac24d4948ad64c611c4990663c7586e2f48c8822' 
  AND (
    token = 'zFp2/x9lKZK6lzbAnj2KeJq7RredwKVXsf4vcsq9j3M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046