UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ofsyVT5gUDIRV9wylYT2Hjrgm2U+Ld3Skft4iLb1pEs=' 
WHERE 
  key_id = '90ff751eb0e806ef9de2557506bf4a4ca52d2bbb9330a49d15a81e4f8eb00552' 
  AND (
    token = 'ofsyVT5gUDIRV9wylYT2Hjrgm2U+Ld3Skft4iLb1pEs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020