UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Q2syqpUbJFvBi3/YiIw0YLqpjlu0mPy4pHp71y/zfc='
WHERE
key_id = '39f35f6acddbf53d81a78c0a40bc1ccbeb7b6cc1e29ddf0d532bb85001f9e7bd'
AND (
token = '1Q2syqpUbJFvBi3/YiIw0YLqpjlu0mPy4pHp71y/zfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)