UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tjLDcSKgCMKKb1WQR5VjSBuv86bi/6pvVJcgFzcnI2o=' 
WHERE 
  key_id = 'f9841de74438234029de7aa80133d48e22266bd82ef4528ac1e136c74cec246a' 
  AND (
    token = 'tjLDcSKgCMKKb1WQR5VjSBuv86bi/6pvVJcgFzcnI2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033