UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'py5t+Vc+QiU0XCF8BsMeEEKeEqpMN9v9hPLhjDzjDXI='
WHERE
key_id = '79f89ac629b3215ea6c36ad06a5d8958ddf719aa110882107ffb27dff628b99f'
AND (
token = 'py5t+Vc+QiU0XCF8BsMeEEKeEqpMN9v9hPLhjDzjDXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)