UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dHYB85/MJ2/wjSEEJyE0mI19vYp6Y1SoWNh6P/k1uHk='
WHERE
key_id = '5e467a816056ccfe346c269d065567a6aa5b179bbd5555939e9ebcc51914bf4b'
AND (
token = 'dHYB85/MJ2/wjSEEJyE0mI19vYp6Y1SoWNh6P/k1uHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)