UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ITam+gZZJLdmEzqNEA20ERwLz/fI2CG2nymXmyiOLZ0='
WHERE
key_id = '8fb783c254cbd47ad100dbeeed5884e94fa9737033de9b39038767bdc01227db'
AND (
token = 'ITam+gZZJLdmEzqNEA20ERwLz/fI2CG2nymXmyiOLZ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)