UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Bosbs/0WFeAwvm3su4QAfYnYNjmFT7QHEYSifjnUoA='
WHERE
key_id = '1cba443abd2c44483041be4d4d9bbb71a506c9081ff925f945f6785f785a9e4a'
AND (
token = '3Bosbs/0WFeAwvm3su4QAfYnYNjmFT7QHEYSifjnUoA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)