UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1xSTvF0NWsS7WgjP2un4l+vnoYRmpuByfe0oPQYwp1U='
WHERE
key_id = 'ba6af4799d97d75f0c262be6ee1e406ef40ea0c17b8eee127e08b3f61b64261c'
AND (
token = '1xSTvF0NWsS7WgjP2un4l+vnoYRmpuByfe0oPQYwp1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)