UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LRDJuWrb1ze7HWQsPecVkv2aSyaJqILDIBx6rRqRorQ='
WHERE
key_id = '13b2c47fa5e7bb798addf071cc1af2ddc4bf1653af5e18631c7857002a943a96'
AND (
token = 'LRDJuWrb1ze7HWQsPecVkv2aSyaJqILDIBx6rRqRorQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)