UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CoI7hKduBM7PUOSiYwvsDTqgF2NrGEpSualT9PYI7zQ=' 
WHERE 
  key_id = '070356a10eceb4dd70ac536d10fef4cf6a4f6ed5d87f027688381759f38b6d07' 
  AND (
    token = 'CoI7hKduBM7PUOSiYwvsDTqgF2NrGEpSualT9PYI7zQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015