UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7g9Hrq0kuzJHvabfYQlzj4Cw0Tg3+Wc/ivDCX1dTF1M=' 
WHERE 
  key_id = '4349c642faf6ebfb632d720bdbf5020486d1e7c75b5ce77646f40e7d80e2caf7' 
  AND (
    token = '7g9Hrq0kuzJHvabfYQlzj4Cw0Tg3+Wc/ivDCX1dTF1M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016