UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Iti7yALH6HSBMczAksBwfNlZ5rb5CgNYF2ovtN2sfXs=' 
WHERE 
  key_id = 'ec9e94684286f612219931fe6de47998f73a84069103a64cf318ebaf53cca1d4' 
  AND (
    token = 'Iti7yALH6HSBMczAksBwfNlZ5rb5CgNYF2ovtN2sfXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028