UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4w8JaXpYBVgT9mFE7SDzemwtX98YPNxqzL1oLras5hY='
WHERE
key_id = '2d92ae02f3d498731d47671b49203988842b6ee3676aaaa87a6aae25847bd6e9'
AND (
token = '4w8JaXpYBVgT9mFE7SDzemwtX98YPNxqzL1oLras5hY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)