UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dud7AiLuJjlhX13RA8PGChNAkblXLxmkqQ7Q0GuXGMY='
WHERE
key_id = '34055c24ab6f418c2f375ba873ce05fddae618e3cb65647276b4045a0d4ec3f3'
AND (
token = 'Dud7AiLuJjlhX13RA8PGChNAkblXLxmkqQ7Q0GuXGMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)