UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZxeXnJ4sav/bXlKEwRS5smnVm8fBlJdzlAphl0DA6io='
WHERE
key_id = '322410d4a191decd866fea452be5b3637eb7d130ef8a16c359638ac1ea740c49'
AND (
token = 'ZxeXnJ4sav/bXlKEwRS5smnVm8fBlJdzlAphl0DA6io='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)