UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8qBKWGfM6/LdQtmcmHV7kRJUvHvCNb24jsyNcA7WdlE=' 
WHERE 
  key_id = '41f3639ddd84c647d4d81b64b2b3f600e920c9227953d7699591032d612be8e0' 
  AND (
    token = '8qBKWGfM6/LdQtmcmHV7kRJUvHvCNb24jsyNcA7WdlE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026