UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oq2kl5xtllC5u5YN1jdR2XQyMfWrVcBQK4+sPhQgat4=' 
WHERE 
  key_id = '0a553bf402dea11dde3f0ed517fa212180c58728cdcf450e2dafd8f034d3a648' 
  AND (
    token = 'Oq2kl5xtllC5u5YN1jdR2XQyMfWrVcBQK4+sPhQgat4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029