UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RHrB/sQkl/k6QAMELUqGH6BaxonHJKE+TcaNbAbtASQ=' 
WHERE 
  key_id = 'df6d9a562f468c46ef89e437156da96b9ea85b468a7740cae9d756a9f8e29ecd' 
  AND (
    token = 'RHrB/sQkl/k6QAMELUqGH6BaxonHJKE+TcaNbAbtASQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033