UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ePbelZK9+nSucWuCLZM2Gg3OLiBIxddRlpe2WIisol4='
WHERE
key_id = '6e180304ed1fcb2321f49a472e311ea8594be929cde28d3417e3fc756ae525dc'
AND (
token = 'ePbelZK9+nSucWuCLZM2Gg3OLiBIxddRlpe2WIisol4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)