UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '853xr2OUi5rxLpxkvRMT+9M8JAjGyQY+1v7BNtMvQ94='
WHERE
key_id = 'e3d177b34e8d7e113bfa611d453828836989939ac6f9093e9e0a182d7866d764'
AND (
token = '853xr2OUi5rxLpxkvRMT+9M8JAjGyQY+1v7BNtMvQ94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)