UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a19OEVVmw3Bdoppy9nj4/JKY/cJ9Xzwtk/ryjq6xg/k='
WHERE
key_id = '94645f822f89fcf9ad39b2b6511d8652012017f6b6912a05558702dad8237d24'
AND (
token = 'a19OEVVmw3Bdoppy9nj4/JKY/cJ9Xzwtk/ryjq6xg/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)