UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mnC5H1HxQa21R1Rnsb7CXHJ7i45ME65stET5L/7kgBw='
WHERE
key_id = '2fcd785e3ba5468f34246361b5b9d99d325ad15043d34a3ad918043114df3bbc'
AND (
token = 'mnC5H1HxQa21R1Rnsb7CXHJ7i45ME65stET5L/7kgBw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)