UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ea+t864opi36gfCq/M0bX/5P7qvA8DBRoHMDaXFoR7s='
WHERE
key_id = '39dca5dbabb11a20b3eefea543be997da39d940cc01ee762ea3abba1d0f396f4'
AND (
token = 'Ea+t864opi36gfCq/M0bX/5P7qvA8DBRoHMDaXFoR7s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)