UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fJjn/1lRXysHa4bTDrFdb7VGWQPPttYFcqjUfJ1NWXA=' 
WHERE 
  key_id = '962295f7d3abd74b208a1fc703826de53ec47f69904df66ade34b2157e248558' 
  AND (
    token = 'fJjn/1lRXysHa4bTDrFdb7VGWQPPttYFcqjUfJ1NWXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019