UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mlnhgH7pdNPDZvg//eb6NPNa9DuOAQU5Nx/9AJC2lvU='
WHERE
key_id = 'dd60122fb5d44efd280b81d64e6dc461612045c567ab5a26389f0bbecfe5d39e'
AND (
token = 'mlnhgH7pdNPDZvg//eb6NPNa9DuOAQU5Nx/9AJC2lvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)