UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wO/qvqqr3k1O8aMEegqzBLYtfBpSWhDUcHIz2fvhue8=' 
WHERE 
  key_id = 'a2f92e47717d9607655632a407e32a413b553215c58d6ed0bfc5a1933f45a982' 
  AND (
    token = 'wO/qvqqr3k1O8aMEegqzBLYtfBpSWhDUcHIz2fvhue8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015