UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CUNTex1sF/UbutJ6jeml+OUXTCCes1xxkm12PKEz97w='
WHERE
key_id = '34ffc938aec5d7fd7ee7bd5d4ba987bf2cd5149e32f825756950967db7f353db'
AND (
token = 'CUNTex1sF/UbutJ6jeml+OUXTCCes1xxkm12PKEz97w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)